package com.wpzf.system.domain;

import com.wpzf.common.core.annotation.Excel;
import com.wpzf.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Set;

/**
 * 平台表 sys_platform
 *
 * @author wpzf
 */
public class SysPlatform extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 平台ID
     */
    @Excel(name = "平台序号", cellType = Excel.ColumnType.NUMERIC)
    private Long platformId;

    /**
     * 平台名称
     */
    @Excel(name = "平台名称")
    private String platformName;

    /**
     * 平台权限
     */
    @Excel(name = "平台权限")
    private String platformKey;

    /**
     * 平台排序
     */
    @Excel(name = "平台排序")
    private Integer platformSort;

    /**
     * 平台状态（0正常 1停用）
     */
    @Excel(name = "平台状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    private String isxzq;

    /**
     * 用户是否存在此平台标识 默认不存在
     */
    private boolean flag = false;

    @Transient
    private String beginTime;
    @Transient
    private String endTime;
    /**
     * 菜单组
     */
    private Long[] menuIds;

    /**
     * 部门组（数据权限）
     */
    private Long[] deptIds;

    /**
     * 平台菜单权限
     */
    private Set<String> permissions;

    public SysPlatform() {

    }

    public SysPlatform(Long platformId) {
        this.platformId = platformId;
    }

    public Long getPlatformId() {
        return platformId;
    }

    public void setPlatformId(Long platformId) {
        this.platformId = platformId;
    }

    @NotBlank(message = "平台名称不能为空")
    @Size(min = 0, max = 30, message = "平台名称长度不能超过30个字符")
    public String getPlatformName() {
        return platformName;
    }

    public void setPlatformName(String platformName) {
        this.platformName = platformName;
    }

    @NotBlank(message = "权限字符不能为空")
    @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
    public String getPlatformKey() {
        return platformKey;
    }

    public void setPlatformKey(String platformKey) {
        this.platformKey = platformKey;
    }

    @NotNull(message = "显示顺序不能为空")
    public Integer getPlatformSort() {
        return platformSort;
    }

    public void setPlatformSort(Integer platformSort) {
        this.platformSort = platformSort;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Long[] getMenuIds() {
        return menuIds;
    }

    public void setMenuIds(Long[] menuIds) {
        this.menuIds = menuIds;
    }

    public Long[] getDeptIds() {
        return deptIds;
    }

    public void setDeptIds(Long[] deptIds) {
        this.deptIds = deptIds;
    }

    public Set<String> getPermissions() {
        return permissions;
    }

    public void setPermissions(Set<String> permissions) {
        this.permissions = permissions;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getIsxzq() {
        return isxzq;
    }

    public void setIsxzq(String isxzq) {
        this.isxzq = isxzq;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("platformId", getPlatformId())
                .append("platformName", getPlatformName())
                .append("platformKey", getPlatformKey())
                .append("platformSort", getPlatformSort())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .append("isxzq", getIsxzq())
                .toString();
    }
}
